package com.hhx.ec.utils;

import us.codecraft.webmagic.Spider;
import us.codecraft.webmagic.downloader.HttpClientDownloader;

public class Testvido {

	
	public static void main(String[] args) {
		   String startUrl = "http://www.ctdsb.net/#sp";
	         String baseUrl = "";
	         String spiderUrl = "https://v.qq.com/channel/movie";
	         String videoUrlTag = "//video/@src";
	         String videoTitleTag = "//div[@class='page-header']/h3/text()";
	         String downloadPath = "E:/webmagic_test/";
	         
	         int cpuN = 2;
	         Spider.create(new WebmagicUtils(baseUrl, spiderUrl, videoUrlTag, videoTitleTag, downloadPath))
	                .addUrl(startUrl)
	                //.addPipeline(new VideoPipeline())
	                .setDownloader(new HttpClientDownloader())
	                .thread(cpuN+1)
	                .run();
	}
}
